package com.fenyin.samples.study.jvm.memory;  
/**
 * VM args:-Xss128K
 *@Title:  
 *@Description:  JVM栈内存溢出例子
 *@Author:fengzhichao  
 *@Since:2012-8-25  
 *@Version:1.1.0
 */
public class StackMemoryError {
	
	private int stackLenth = 1;
	
	public void stackApply(){
		stackLenth++;
		stackApply();
	}
	
	public static void main(String[] args) throws Exception{
		StackMemoryError memoryError = new StackMemoryError();
		try {
			memoryError.stackApply();
		} catch (Exception e) {
			System.out.println("stack length:"+memoryError.stackLenth);
			throw e;
		}
	}
}
